/**
 * ${table.comment!} table columns
 */

import React from "react";
import { Button } from "antd";

export const get${entity}Cols = function (view) {
    return [
        <#-- ----------  BEGIN 字段循环遍历  ---------->
        <#list table.fields as field>
        {
            title: "${field.comment}",
            dataIndex: "${field.propertyName}",
            key: "${field.propertyName}",
            width: 150,
            ellipsis: true
        },
        </#list>
        {
            title: "操作",
            key: "operation",
            fixed: "right",
            width: 245,
            render: (text, record) => {
                return (
                    <div className="table-btn" key={record.key}>
                        <Button
                            type="link"
                            size="small"
                            icon="edit"
                            disabled={record.auditStatus === "2"}
                            onClick={() => view.$${entity?uncap_first}Modal.handleModify(record)}
                        >
                            修改
                        </Button>
                        <Button
                            type="link"
                            size="small"
                            icon="delete"
                            disabled={record.auditStatus === "2"}
                            onClick={() => view.handleRemove(record.id)}
                        >
                            删除
                        </Button>
                    </div>
                );
            }
        }
    ];
};

export const productColumns = [];
